<template>

  <el-container>
    <el-header class="header" height="100px">
      <h3>博云</h3>
      <p>苏州博云欢迎你！</p>
    </el-header>
    <div style="margin-top:5px">
      <el-row :gutter="10">
        <el-col :xs="4" :sm="4" :md="4" :lg="4">
          <div>
            <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
              <el-radio-button :label="false">展开</el-radio-button>
              <el-radio-button :label="true">收起</el-radio-button>
            </el-radio-group>
            <el-menu default-active="1-4-1" class="el-menu-vertical-demo"
                     @open="handleOpen" @close="handleClose" :collapse="isCollapse">
              <el-submenu :index="item.mid" v-for="item in getList">
                <template slot="title">
                  <i class="el-icon-menu"></i>
                  <span slot="title">{{item.mName}}</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item :index="ele.mid" v-for="ele in item.sonMenu">
                    <router-link :to="ele.mRouter">{{ele.mName}}</router-link>
                    <!--{{ele.mName}}-->
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
            </el-menu>
          </div>
        </el-col>
        <el-col :xs="20" :sm="20" :md="20" :lg="20">

          <!--<div>-->
            <!--<div style="border: 1px solid #A6A6A6; border-radius:6px; padding:5px; margin:2px; background-color: white">-->
              <!--<el-breadcrumb separator="/">-->
                <!--<el-breadcrumb-item v-for="item in breadcrumbItems">{{item}}</el-breadcrumb-item>-->
              <!--</el-breadcrumb>-->
            <!--</div>-->
          <!--</div>-->

          <div style="margin-top:10px">
            <router-view></router-view>
          </div>
        </el-col>
      </el-row>
    </div>
  </el-container>
</template>

<script>
  export default {
    data() {
      return {
        isCollapse: false,
        getList:[],
      }
    },
    methods: {
      getmenu() {
        console.log(111)
        var url = '/emp/menu';
        this.axios.post(url).then(res => {
         console.log(res);
          this.getList=res.data.data;
        });
      },
      handleOpen(key, keyPath) {
      },
      handleClose(key, keyPath) {
      }

  },
    mounted() {
    this.getmenu()
  }
  }
</script>

<style>
  .header{
    background-color: #409EFF;
    color: white;
  }
  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }
</style>
